def get_odd(start, end):
    xlist = []
    for x in range(start, end + 1):
        if x % 2:
            xlist.append(x)
    return xlist


def get_odd_gen(start, end):
    for x in range(start, end + 1):
        if x % 2:
            yield x


def simple_gen():
    print('Will be A.')
    yield 'A'
    print('Will be B.')
    # return 9999
    yield 'B'
    print('Will be C.')
    yield 'C'


if '__main__' == __name__:
    result = get_odd(5, 150)[:5]
    print(result)

    gen = get_odd_gen(5, 150)
    print(gen)
    for i, x in enumerate(gen):
        if i >= 5:
            break
        print(x, end=', ')
    print()

    if 0:
        gen02 = simple_gen()
        print(gen02)
        for x in gen02:
            print(x)
        for x in gen02:
            print(x)

    else:
        print('---------')
        gen03 = simple_gen()
        print('----------')
        print(next(gen03))
        print('----------')
        print(next(gen03))
